import collections


class MyQueue(object):

    def __init__(self):
        self.stack = collections.deque()
        self.supp = collections.deque()

    def push(self, x):
        """
        :type x: int
        :rtype: None
        """
        self.stack.append(x)

    def pop(self):
        """
        :rtype: int
        """
        if not self.supp:
            while self.stack:
                node = self.stack.pop()
                self.supp.append(node)
        return self.supp.pop()

    def peek(self):
        """
        :rtype: int
        """
        if not self.supp:
            while self.stack:
                node = self.stack.pop()
                self.supp.append(node)
        return self.supp[-1]

    def empty(self):
        """
        :rtype: bool
        """
        if not self.stack and not self.supp:
            return False
        else:
            return True
